Skip to content

Fix multiarch Docker build and optimize CI#3

Merged
gricha merged 2 commits intomainfrom
fix/docker-multiarch-build
Jan 5, 2026
Merged

Fix multiarch Docker build and optimize CI#3
gricha merged 2 commits intomainfrom
fix/docker-multiarch-build

Conversation

@gricha
Copy link
Copy Markdown
Owner

@gricha gricha commented Jan 5, 2026

Summary

  • Fix Tectonic downloads for both architectures: Use musl-based binaries (statically linked) instead of glibc ones to avoid missing library issues
  • Fix Tectonic download URL: Use the versioned release path with proper URL encoding
  • Add native arm64 runner: Build arm64 natively on ubuntu-24.04-arm instead of QEMU emulation
  • Parallel builds with manifest merge: Build both architectures in parallel on native runners, then merge into multi-arch manifest
  • Add BuildKit optimizations: Syntax directive, apt cache mounts, --no-install-recommends

Performance Comparison

Build Before After Improvement
arm64 ~38 min (QEMU) 3m49s (native) ~10x faster
amd64 ~3 min 5m4s (full rebuild) Similar
Total ~40 min ~5 min ~8x faster

Root Cause

  1. Original arm64 failure: Tectonic only provides aarch64-unknown-linux-musl binaries, not aarch64-unknown-linux-gnu
  2. amd64 failure after optimization: --no-install-recommends removed libgraphite2.so.3 needed by glibc binaries

Solution

  • Use musl binaries for both architectures (statically linked, no runtime deps)
  • Use registry-based caching for faster incremental builds
  • Use native arm64 runners for massive speedup

Test plan

  • Triggered workflow_dispatch on fix branch
  • arm64 build succeeded (3m49s)
  • amd64 build succeeded (5m4s)
  • Manifest merge succeeded
  • Image pushed to ghcr.io

🤖 Generated with Claude Code

gricha and others added 2 commits January 5, 2026 16:35
- Fix Tectonic arm64: use aarch64-unknown-linux-musl (not gnu)
- Fix Tectonic download URL to use proper versioned path
- Add BuildKit syntax directive and apt cache mounts
- Combine apt install layers for build deps
- Add --no-install-recommends to reduce image size
- Use native arm64 runner (ubuntu-24.04-arm) instead of QEMU
- Build archs in parallel on native runners, then merge manifests
- Use registry-based caching for faster rebuilds

The arm64 build was failing because Tectonic only provides
musl-based binaries for aarch64, not glibc ones.

Build time should improve significantly:
- Native arm64 runner vs QEMU emulation (~10x faster)
- Registry caching for layer reuse across builds
- BuildKit apt cache mounts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Switched from glibc to musl binaries for amd64 as well since
--no-install-recommends doesn't include libgraphite2 and other
libraries that the glibc binary needs.

musl binaries are statically linked so they work without additional
runtime dependencies.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@gricha gricha merged commit 1fe041b into main Jan 5, 2026
5 checks passed
@gricha gricha deleted the fix/docker-multiarch-build branch January 7, 2026 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant